package com.hmdp.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RedissonConfig {

    @Bean
    public RedissonClient redissionClient() {

        Config config = new Config();
        //多集群对应useClusterServers()
        config.useSingleServer()
                .setAddress("redis://172.18.112.119:6379")
                .setPassword("123");
        // 创建RedissonClient实例
        RedissonClient redissonClient = Redisson.create(config);
        return redissonClient;

    }




}
